package com.xiaoran.springboot3.exception;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

@ControllerAdvice
@Slf4j
public class GlobalException {
    @ExceptionHandler({ArithmeticException.class,NullPointerException.class})
    public String handlerAxException(Exception e){
        log.error("我们捕获到的异常是：{}",e);
        return "login";
    }
}
